﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EcologyFuture.Kernel
{
  using EcologyFuture.DataCollection;
  using EcologyFuture.DataStorage;
  /// <summary>
  /// <c>Kernel</c> class is the main class in whole EcologyFuture project.
  /// It manages all operations and distributes it between modules.
  /// </summary>
  class Kernel
  {
    /// <summary>
    /// The instance of <c>DataCollectionKernel</c>.
    /// </summary>
    private DataCollectionKernel dataCollectionKernel;
    /// <summary>
    /// The instance of <c>DataStorageKernel</c>.
    /// </summary>
    private DataStorageKernel dataStorageKernel;
    /// <summary>
    /// Initializes a new instance of <c>Kernel</c> class.
    /// Perform instantiation of all modules.
    /// </summary>
    public Kernel()
    {
      dataCollectionKernel = new DataCollectionKernel();
      dataStorageKernel = new DataStorageKernel();
    }
    /// <summary>
    /// An entry point to program.
    /// </summary>
    /// <param name="args">Command line arguments.</param>
    static void Main(string[] args)
    {
      Kernel kernel = new Kernel();
      if (true)//(args.Length > 0 && "-collect_data" == args[0])
      {
        List<WeatherInfo> data = kernel.dataCollectionKernel.CollectData();
        kernel.dataStorageKernel.Save(data);
      }
    }
  }
}
